public class FactorialOfN {

    public static int func(int n) {
        if (n == 1) {
            return 1;
        }
        return n * func(n-1);
    }

    public static void main(String[] args) {
        int ret = func(5);
        System.out.println(ret);
    }
}
